<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<html:html locale="true">
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title></title>
<link href="console.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-size: 16px}
-->
.even {
	background:	#eee;
}

.odd {

}
</style>
</head>

<body>
<jsp:include page="/title.jsp" flush="true"/>
	<p class="lnkhead2"><bean:message key="menu.componentLibrary"/>&gt;<bean:message key="menu.dataComponents"/>&gt;<bean:write name="datatype" property="metaType"/>&gt;
	<a  href="component.do?act=queryDataDetail&typeId=<bean:write name="datatype" property="typeId"/>">
				<bean:write name="datatype" property="typeId"/>
				</a>
	
	</p>
	<form name="form" method="post" action="component.do">
	<input type="hidden" name="attrName" value='<bean:write name="attr" property="typeName"/>'/>
	<input type="hidden" name="oldtypeId" value='<bean:write name="datatype" property="typeId"/>'/>
	<input type="hidden" name="isDatabase" value='<bean:write name="datatype" property="isDatabase"/>'/>
	<input type="hidden" name="act"/>
	<table width="723" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr class="txtnormal2">
    <td height="32" ><div align="right">ID&nbsp;</div></td>
    <td><html:text name="attr" property="typeName"/></td>
  </tr>
   <tr  class="txtnormal2">
    <td height="32" ><div align="right"><bean:message key="heading.name"/>&nbsp;</div></td>
    <td> 
    <html:text name="attr" property="tableName"/>
    </td>
  </tr>
  <tr class="txtnormal2">
    <td  height="32"><div align="right"><bean:message key="heading.type"/>&nbsp;</div></td>
    <td ><html:select name="attr" size="1" property="typeId"> 
<html:options collection="typelist" property="typeId"/> 
                </html:select>
                </td>
  </tr>
  <tr  class="txtnormal2">
    <td height="32"><div align="right"><bean:message key="component.length"/>&nbsp;</div></td>
    <td > 
    <html:text name="attr" property="length"/>
    </td>
  </tr>
  <tr  class="txtnormal2">
    <td height="32"><div align="right"><bean:message key="component.displaySize"/>&nbsp;</div></td>
    <td > 
    <html:text name="attr" property="size"/>
    </td>
  </tr>
  <tr class="txtnormal2">
    <td height="32"><div align="right"><bean:message key="heading.desc"/>&nbsp;</div></td>
    <td ><html:textarea name="attr" property="desc"  cols="48" rows="4"/></td>
  </tr>
  <logic:equal name="datatype" property="isDatabase" value="true">
  <tr class="txtnormal2">
    <td height="32"><div align="right"><bean:message key="component.tableField"/>&nbsp;</div></td>
    <td>
    <html:text name="attr" property="columnName" />
     </td>
  </tr>
 
  </logic:equal>
   <tr  class="txtnormal2">
    <td height="32"><div align="right"><input  type="reset" name="Submit" value="<bean:message key="button.reset"/>" /></div></td>
    <td> 
    <input  type="button" name="Submit" value="<bean:message key="button.update"/>" onclick="javascript:update()"/>
    </td>
  </tr>
  </table>
  
  
</form>
<script type="text/javascript">
	/*function goback(){
		var frm = document.forms["form"];
		frm.elements["act"].value = "queryDataDetail";
		frm.elements["typeId"].value = frm.elements["oldtypeId"].value
		frm.submit();
	}*/
	function update(){
		var frm = document.forms["form"];
		frm.elements["act"].value = "updateAttrData";
		if(!checkId(frm.elements["typeName"],"ID")){
			return;
		}
		if(frm.elements["length"].value!="" && frm.elements["length"].value <=0){
		      alert("<bean:message key="component.lengthMustLarge"/>");
		      return;
		}
		
		if(frm.elements["isDatabase"].value == "true"){
			if(!checkId(frm.elements["columnName"],"<bean:message key="component.tableField"/>")){
				return;
			}
			if(frm.elements["tableName"].value == ""){
			 alert("<bean:message key="component.needName"/>!");
				return;
			}
		}
		frm.submit();
	}
	
</script>
<logic:notEmpty name="returnMsg">
	<script>
	alert('<bean:write name="returnMsg"/>');
	</script>
	</logic:notEmpty>
<%@ include file="/bottom.jsp" %>
</body>
</html:html>



